package ab_pract;

public class NodesDistance implements Comparable<NodesDistance> {
	private int node1;
	private int node2;
	private int distance;
	
	public NodesDistance(int node1,int node2, int distance) {
		this.node1 = node1;
		this.node2 = node2;
		this.distance = distance;
	}
	
	public int getNode1() {
		return node1;
	}
	
	public int getNode2() {
		return node2;
	}
	
	public int getDistance() {
		return distance;
	}

	@Override
	public int compareTo(NodesDistance nodeDistance2) {
		// TODO Auto-generated method stub
		if (distance<nodeDistance2.getDistance()) {
			return -1;
		}
		else if (distance>nodeDistance2.getDistance()) {
			return 1;
		}
		else return 0;
	}
}
